Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 3 - Standard Image-Compression Dialog Components / Standard Image-Compression Dialog Components Reference
Standard Image-Compression Dialog Component Functions / Specifying a Test Image


SCSetTestImagePictHandle

The SCSetTestImagePictHandle function sets the dialog box's test image from a picture that is stored in a handle.

pascal ComponentResult SCSetTestImagePictHandle 
                     (ComponentInstance ci, PicHandle testPict,
                      Rect *testRect, short testFlags);
ci
Identifies your application's connection to a standard image-compression dialog component.
testPict
Identifies a handle that contains the new test image. Your application is responsible for disposing of this handle when you are done with it. You must clear the image or close your connection to the standard image-compression dialog component before you dispose of this handle or close the corresponding resource file. You must set this handle as nonpurgeable.
Set this parameter to nil to clear the test image.
testRect
Contains a pointer to a rectangle structure. This rectangle specifies, in the coordinate system of the source image, the area of interest or point of interest in the test image. The area of interest defines a portion of the test image that is to be shown to the user in the dialog box. Use this parameter to direct the component to a specific portion of the test image. The component uses the value of the testFlags parameter to determine how it transforms this image before displaying it to the user. The component uses the testFlags parameter only when the test image is larger than the test image portion of the dialog box.
You may specify a point of interest by setting the points in the rectangle structure so that they enclose a single point--for example, (0,0) and (1,1). The component centers this point in the image that is displayed in the dialog box, and displays the part of the image that fits in the test image portion of the dialog box.
To use the entire picture, specify nil in this parameter.
testFlags
Specifies how the component is to display a test image that is larger
than the test image portion of the dialog box. If you set this parameter to 0, the component uses a default method of its own choosing. In all cases, the component centers the area or point of interest in the test image portion of the dialog box, and then displays some part of the test image.
You may indicate your display preference by setting this parameter to one of the following values:
scPreferCropping

Indicates that the component should crop the test image to fit the test image portion of the dialog box. The component displays the part of the image that fits in the test image portion of the box. If the image is smaller than the space allotted in the dialog box, the component does not alter the image before displaying it--the resulting image is smaller than the available space.
scPreferScaling

Indicates that the component should scale the test image
to fit the test image portion of the dialog box. The component shrinks the image to fit the test image portion of the dialog box.
scPreferScalingAndCropping

Indicates that the component should both scale and crop the test image. This option is useful with very large test images. The component first shrinks the image to approximately the size of the test image portion of the dialog box, and then trims the image so that it fits the available space.
RESULT CODE
paramErr-50Invalid parameter specified

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help